package Weapons;

import org.newdawn.slick.geom.Vector2f;

import game.Config.BulletFactory;
/**
 * This class represents a Freezegun in the game.
 * The freezegun extends Scattergun, and will thus fire
 * bullets in all directions. Bullets fired by the freezegun
 * will also slow the target hit.
 * @author Sebastian Isheden and Victor Beer
 */
public class FreezeGun extends ScatterGun{


	private float freezeTime;
	private float freezePercent;
	/**
	 * Creates a Freezegun with given parameters.
	 * @param fireRate	The amount of times this weapon can fire per second.
	 * @param damage  The damage per shot of this weapon.
	 * @param bulletSpeed  The speed the fired bullets will traverse the screen.
	 * @param numBullets  The number of bullets fired.
	 * @param fadeDistance The distance the bullets can travel before disappearing.
	 * @param freezeTime  The time targets will be frozen when hit by bullets fired by this gun.
	 * @param freezePercent  The amount this gun will slow targets it hits. 
	 */
	public FreezeGun(float fireRate, float damage, float bulletSpeed, float numBullets,float fadeDistance,float freezeTime,float freezePercent) {
		super(fireRate, damage, bulletSpeed,numBullets,fadeDistance);
		this.freezePercent = freezePercent;
		this.freezeTime = freezeTime;
	}
	/**
	 * Returns a copy of the Freezegun.
	 */
	@Override
	public FreezeGun copy() {
		return new FreezeGun(1/this.fireInterval,this.damage,this.bulletSpeed,this.numberOfBullets,this.fadeDistance,this.freezeTime,this.freezePercent);
	}

	@Override
	protected void callFactory(Vector2f position, Vector2f direction) {
		BulletFactory.createIceBullet(this.damage,this.bulletSpeed,position,direction,this.fadeDistance,this.freezeTime,this.freezePercent);
		
	}

}
